// 配置路由规则
import Vue from 'vue'
import VueRouter from 'vue-router'
//登陆页面 3个主要页面  两个员工界面 注册页面
import loginpage from "../views/loginpage.vue"
import register from"../components/register.vue"
import main1 from '../views/main1.vue'
import main2 from "../views/main2.vue"
import main3 from "../views/main3.vue"
import employee1 from "../views/employee1.vue"
import employee2 from "../views/employee2.vue"



//页面1的子页面
import goods_maintenance from "../components/components-main1/goods_maintenance.vue"
import customer_management from "../components/components-main1/customer_management.vue"
import order_record from "../components/components-main1/order_record.vue"
import sales_statistics from "../components/components-main1/sales_statistics.vue"
import profit_statistics from "../components/components-main1/profit_statistics.vue"
import purchase_services from "../components/components-main1/purchase_services.vue"
import quotation_management from "../components/components-main1/quotation_management.vue"
import supplier from "../components/components-main1/supplier.vue"
import employee_management from "../components/components-main1/employee_management.vue"
import follow_up_record from "../components/components-main1/follow_up_record.vue"
import capital_account from "../components/components-main1/capital_account.vue"
import home_page_configuration from "../components/components-main1/home_page_configuration.vue"
import warehouse_management from "../components/components-main1/warehouse_management.vue"
import receipt_document from "../components/components-main1/receipt_document.vue"
import delivery_document from "../components/components-main1/delivery_document.vue"
import warehouse_allocation from "../components/components-main1/warehouse_allocation.vue"
import combinatorial_resolution from "../components/components-main1/combinatorial_resolution.vue"

//具体仓库页面
import warehouse from"../components/warehouse.vue"

//页面2的子页面1
import main2_part1 from "../components/components-main2/main2_part1/main2_part1.vue"
//页面2的子路由2
import change2 from "../components/components-main2/main2_part2/tabchange.vue"
//页面2的子路由3
import change3 from "../components/components-main2/main2_part3/tabchange.vue"
//页面2的子路由4
import change4 from "../components/components-main2/main2_part4/tabchange.vue"
//页面2的子路由5
import change5 from "../components/components-main2/main2_part5/tabchange.vue"
//页面2的子路由6
import change6 from "../components/components-main2/main2_part6/tabchange.vue"
//页面2的子路由7
import change7 from "../components/components-main2/main2_part7/tabchange.vue"

//员工界面考勤打卡
import employee_clockin from"../components/employee_components/employee_clockin.vue"
//员工界面销量上报
import employee_salesreport from"../components/employee_components/employee_salesreport.vue"
//员工界面我的销量
import employee_mysales from"../components/employee_components/employee_mysales.vue"

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'loginpage',
    component: loginpage
  },
  {
    path:"/register",
    name:"register",
    component:register
  },
  //主体部分
  {
    path: '/main1',
    name: 'main1',
    component: main1
  },
  {
    path: "/main2",
    name: "main2",
    component: main2,
    children: [{
        path: "part2",
        name: "part2",
        component: change2
      },
      {
        path: "part3",
        name: "part3",
        component: change3
      },
      {
        path: "part4",
        name: "part4",
        component: change4
      },
      {
        path: "part5",
        name: "part5",
        component: change5
      },
      {
        path: "part6",
        name: "part6",
        component: change6
      },
      {
        path: "part7",
        name: "part7",
        component: change7
      }
    ]
  },
  {
    path: "/main3",
    name: "main3",
    component: main3
  },
  //main1部分
  {
    path: "/goods_maintenance",
    name: "goods_maintenance",
    component: goods_maintenance
  },
  {
    path: "/customer_management",
    name: "customer_management",
    component: customer_management
  },
  {
    path: "/order_record",
    name: "order_record",
    component: order_record
  },
  {
    path: "/sales_statistics",
    name: "sales_statistics",
    component: sales_statistics
  },
  {
    path: "/profit_statistics",
    name: "profit_statistics",
    component: profit_statistics
  },
  {
    path: "/purchase_services",
    name: "purchase_services",
    component: purchase_services
  },
  {
    path: "/quotation_management",
    name: "quotation_management",
    component: quotation_management
  },
  {
    path: "/supplier",
    name: "supplier",
    component: supplier
  },
  {
    path: "/employee_management",
    name: "employee_management",
    component: employee_management
  },
  {
    path: "/follow_up_record",
    name: "follow_up_record",
    component: follow_up_record
  },
  {
    path: "/capital_account",
    name: "capital_account",
    component: capital_account
  },
  {
    path: "/home_page_configuration",
    name: "home_page_configuration",
    component: home_page_configuration
  },
  {
    path: "/warehouse_management",
    name: "warehouse_management",
    component: warehouse_management
  },
  {
    path: "/receipt_document",
    name: "receipt_document",
    component: receipt_document
  },
  {
    path: "/delivery_document",
    name: "delivery_document",
    component: delivery_document
  },
  {
    path: "/warehouse_allocation",
    name: "warehouse_allocation",
    component: warehouse_allocation
  },
  {
    path: "/combinatorial_resolution",
    name: "combinatorial_resolution",
    component: combinatorial_resolution
  },

  //main2部分
  {
    path: "/main2_part1",
    name: "main2_part1",
    component: main2_part1
  },


  //员工页面部分
  {
    path: "/employee1",
    name: "employee1",
    component: employee1
  },
  {
    path: "/employee2",
    name: "employee2",
    component: employee2
  },
  //功能部分
  //考勤打卡
  {
    path:"/employee_clockin",
    name:"employee_clockin",
    component:employee_clockin
  },
  //提交销量
  //我的销量
  {
    path:"/employee_salesreport",
    name:"employee_salesreport",
    component:employee_salesreport
  },
  {
    path:"/employee_mysales",
    name:"employee_mysales",
    component:employee_mysales
  },
  // 具体仓库部分
  {
    path:"/warehouse",
    name:"warehouse",
    component:warehouse
  }
]

//设置路由拦截



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
